<!DOCTYPE html>
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>highlight.asm-picsrc</title>
<meta name="generator" content="KF5::SyntaxHighlighting - Definition (PicAsm) - Theme (Breeze Dark)"/>
</head><body style="background-color:#232629;color:#cfcfc2"><pre>
                <span style="color:#7a7c7d;">; Blank line</span>
<span style="color:#8e44ad;">loop</span>  <span style="font-weight:bold;">sleep</span>     <span style="color:#7a7c7d;">; Label and operation</span>
      <span style="font-weight:bold;">incf</span> <span style="color:#f67400;">6</span>,<span style="color:#f67400;">1</span>  <span style="color:#7a7c7d;">; Operation with 2 parameters</span>
      <span style="color:#fdbc4b;font-weight:bold;">goto</span> loop <span style="color:#7a7c7d;">; Operation with 1 parameter</span>

<span style="color:#27ae60;">#define</span> X Y
<span style="color:#27ae60;">#</span><span style="color:#da4453;text-decoration:underline;">defin</span> <span style="color:#7a7c7d;">; incomplete</span>
<span style="color:#27ae60;">#undefine</span> X

<span style="color:#8e44ad;">number</span> <span style="color:#27ae60;">equ</span> <span style="color:#f67400;">5</span>

<span style="color:#8e44ad;">label_</span><span style="color:#3daee9;">#v</span>((number + <span style="color:#f67400;">1</span>) * <span style="color:#f67400;">5</span>)<span style="color:#8e44ad;">_suffix</span> <span style="color:#27ae60;">equ</span> <span style="color:#f67400;">0x</span><span style="color:#f67400;">10</span>

<span style="color:#27ae60;">db</span> <span style="color:#f67400;">.</span><span style="color:#f67400;">34</span>,<span style="color:#f67400;">O'</span><span style="color:#f67400;">35</span><span style="color:#f67400;">'</span>,<span style="color:#f67400;">O'</span><span style="color:#da4453;text-decoration:underline;">9</span>3',<span style="color:#f67400;">0x</span><span style="color:#f67400;">Af</span>,<span style="color:#f67400;">0x</span><span style="color:#f67400;">ad</span><span style="color:#da4453;text-decoration:underline;">y</span>,<span style="color:#3daee9;">a'a'</span>,<span style="color:#3daee9;">a'a</span><span style="color:#da4453;text-decoration:underline;">p</span>,<span style="color:#3daee9;">A'\'</span>

<span style="color:#8e44ad;">any</span>   <span style="color:#27ae60;">macro</span> parm
      <span style="font-weight:bold;">movlw</span> parm
      <span style="color:#27ae60;">endm</span>
      any <span style="color:#f67400;">33</span>

<span style="color:#7a7c7d;">; Shift reg left</span>
<span style="color:#8e44ad;">slf</span>   <span style="color:#27ae60;">macro</span> reg
      <span style="color:#000000;font-weight:bold;font-style:italic;">clrc</span>
      <span style="font-weight:bold;">rlf</span>   reg,f
<span style="color:#27ae60;">endm</span>

<span style="color:#7a7c7d;">; Scale W by “factor”. Result in “reg”, W unchanged.</span>
<span style="color:#8e44ad;">scale</span> <span style="color:#27ae60;">macro</span> reg, factor
      <span style="color:#27ae60;">if</span> (factor == <span style="color:#f67400;">1</span>)
          <span style="font-weight:bold;">movwf</span> reg                <span style="color:#7a7c7d;">; 1 X is easy</span>
      <span style="color:#27ae60;">else</span>
          scale reg, (factor / <span style="color:#f67400;">2</span>)  <span style="color:#7a7c7d;">; W * (factor / 2)</span>
          slf   reg,f              <span style="color:#7a7c7d;">; double reg</span>
          <span style="color:#27ae60;">if</span> ((factor &amp; <span style="color:#f67400;">1</span>) == <span style="color:#f67400;">1</span>)   <span style="color:#7a7c7d;">; if lo-bit set ..</span>
              <span style="font-weight:bold;">addwf</span> reg,f          <span style="color:#7a7c7d;">; .. add W to reg</span>
          <span style="color:#27ae60;">endif</span>
      <span style="color:#27ae60;">endif</span>
<span style="color:#27ae60;">endm</span>

      scale tmp,<span style="color:#f67400;">D'</span><span style="color:#f67400;">10</span><span style="color:#f67400;">'</span>

      <span style="font-weight:bold;">movwf</span>  tmp
      <span style="color:#000000;font-weight:bold;font-style:italic;">clrc</span>
      <span style="font-weight:bold;">rlf</span>    tmp,f
      <span style="font-weight:bold;">addwf</span>  tmp,f

<span style="color:#8e44ad;">spin</span>  <span style="color:#27ae60;">macro</span>  n
      <span style="font-weight:bold;">movlw</span>  n
      <span style="font-weight:bold;">addlw</span>  <span style="color:#f67400;">0x</span><span style="color:#f67400;">ff</span>
      <span style="font-weight:bold;">btfss</span>  STATUS,Z
      <span style="color:#fdbc4b;font-weight:bold;">goto</span>   $-<span style="color:#f67400;">2</span>
<span style="color:#27ae60;">endm</span>

<span style="color:#8e44ad;">LOOP</span>: <span style="font-weight:bold;">BTFSS</span> flag,<span style="color:#f67400;">0x</span><span style="color:#f67400;">00</span>
      <span style="color:#fdbc4b;font-weight:bold;">GOTO</span> LOOP

      
      <span style="font-weight:bold;">BTFSS</span> flag,<span style="color:#f67400;">0x</span><span style="color:#f67400;">00</span>
      <span style="color:#fdbc4b;font-weight:bold;">GOTO</span> $ - <span style="color:#f67400;">1</span>

</pre></body></html>
